package com.auto.survey.activity.monitoring.entity.relations

import androidx.room.Embedded
import androidx.room.Ignore
import androidx.room.Relation
import com.auto.survey.activity.monitoring.entity.MonitorCheckPoint
import com.auto.survey.activity.monitoring.entity.MonitoringPoint

data class PointWithCheckedPoint(
    /**
     * 测点
     */
    @Embedded val point: MonitoringPoint,

    @Relation(parentColumn = "id",
        entityColumn = "pointId",
        entity = MonitorCheckPoint::class)
    val allCheckPoints: List<MonitorCheckPoint>,

    @Relation(
        parentColumn = "id",
        entityColumn = "pointId",
        entity = MonitorCheckPoint::class,
        projection = ["id", "checkPointX", "checkPointY", "checkPointZ",
            "checkPointHz", "checkPointV", "checkPointSD",
            "isChecked", "createTime", "isPass", "isNew"]
    )
    val latestCheck: List<MonitorCheckPoint>, // 实际只会有0或1条记录
)
